package com.mall.util.distributed.raft.rpc.message;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * 请求投票 由候选人发起
 */
@Data
@Accessors(chain = true)
public class RequestVote implements Serializable {
    @Schema(description = "候选人任期")
    private long term;

    @Schema(description = "请求投票的候选人ID")
    private String candidateId;

    @Schema(description = "候选人日志条目最后一条索引")
    private long lastLogIndex;

    @Schema(description = "候选人日志条目最后的任期")
    private long lastLogTerm;
}
